package com.xuexi.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class configBean {

    //AvailabilityFilteringRule 轮询
    @Bean
    @LoadBalanced//    配置负载均衡实现resttemplate,一个注解解决
    public RestTemplate getRestTemplate(){
        return new  RestTemplate();
    }

}
